package cn.itcast.utils;

import cn.hutool.http.HttpRequest;
import lombok.extern.slf4j.Slf4j;

/**
 * Author:zhansan
 * Date:2023/3/25
 * Description:
 */
@Slf4j
public class DingDingUtils {
    private static final String url="https://oapi.dingtalk" +
            ".com/robot/send?access_token=5b8308a19ce91480199f8593e1dacc3d39152d8cb154c16e16fda24987b03858";
    public static void sendMsg(String msg){
            try{
                msg="{\"msgtype\": \"text\",\"text\": {\"content\":\"好消息:"+msg+"\"}}";
                HttpRequest.post(url).body(msg).execute().body();
            }catch (Exception e){
                log.error("#######"+e.getMessage());
            }

    }
}
